package com.nisure.controller;


import java.text.SimpleDateFormat;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.nisure.entities.Student;
import com.nisure.service.StudentService;

@RestController
public class ApiController {

    private Logger logger = LogManager.getLogger(ApiController.class);

    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");

    @Autowired
    private StudentService studentService;

    
    @RequestMapping("/test")
    public String test(){
    	System.out.println("我进来了");
    	Student student = new Student();
    	student.setClassName("13计本2班");
    	student.setName("黄诗水");
    	studentService.insertStudent(student, "db2");
    	return "success";
    }
    
}
